﻿using Beryl.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace Beryl
{
    /// <summary>
    /// SystemPage 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class SystemPage : System.Web.Services.WebService
    {

        [WebMethod]
        public string[] HelloWorld(string Check)
        {
            return Model.SystemController.Instance.getVersion().ToArray();
        }

        [WebMethod(Description = "查询用户")]
        public string[] SelectAllCargoInfor(string User)
        {
            return SystemController.Instance.selectAllCargoInfor(User).ToArray();
        }

        [WebMethod(Description = "查找人员信息")]
        public string[] selectgetPr(string Pr,string Data)
        {
            List<string> list = new List<string>();
            list.Add(SystemController.Instance.selectgetPr(Pr,Data));
            return list.ToArray();
        }

        [WebMethod(Description = "查找设备信息")]
        public string[] selectgetEQ(string EQ,string Data)
        {
            List<string> list = new List<string>();
            list.Add(SystemController.Instance.selectgetEQ(EQ,Data));
            return list.ToArray();
        }

        [WebMethod(Description = "异常提交类")]
        public string[] UpdateExcept(string json, string Data)
        {
            if(json.Contains("'"))
            {
                json = json.Replace("'", " ");
            }
            return Model.SystemController.Instance.updateException(json, Data).ToArray();
        }
    }
}
